x86_emulate: set the operand size for SMSW/reg writeback.
authorKeir Fraser <keir@xen.org>
Wed, 19 Jan 2011 15:29:04 +0000 (15:29 +0000)
committerKeir Fraser <keir@xen.org>
Wed, 19 Jan 2011 15:29:04 +0000 (15:29 +0000)
Otherwise it defaults to 0 bytes.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen/arch/x86/x86_emulate/x86_emulate.c

index d6586d6944ae94daa2a1661d044a0dac870ca2d3..186cef2b9be8bb2d4139afa593997856e9cbfb62 100644 (file)
@@ -3555,8 +3555,7 @@ x86_emulate(
                 goto done;
             break;
         case 4: /* smsw */
-            if ( ea.type == OP_MEM )
-                ea.bytes = 2;
+            ea.bytes = (ea.type == OP_MEM) ? 2 : op_bytes;
             dst = ea;
             fail_if(ops->read_cr == NULL);
             if ( (rc = ops->read_cr(0, &dst.val, ctxt)) )